Integrand size = 23, antiderivative size = 361 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\frac {\cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{\sqrt {a+b} d}-\frac {\cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{\sqrt {a+b} d}+\frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}} \]
[Out]
Time = 0.53 (sec) , antiderivative size = 361, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3981, 3869, 3960, 3918, 21, 3914, 3917, 4089} \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\frac {b^2 \tan (c+d x)}{d \left (a^2-b^2\right ) \sqrt {a+b \sec (c+d x)}}-\frac {\cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{d \sqrt {a+b}}+\frac {\cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right )}{d \sqrt {a+b}}+\frac {2 \sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}} \]
[In]
[Out]
Rule 21
Rule 3869
Rule 3914
Rule 3917
Rule 3918
Rule 3960
Rule 3981
Rule 4089
Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {1}{\sqrt {a+b \sec (c+d x)}}+\frac {\csc ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}}\right ) \, dx \\ & = -\int \frac {1}{\sqrt {a+b \sec (c+d x)}} \, dx+\int \frac {\csc ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx \\ & = \frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}}-\frac {1}{2} b \int \frac {\sec (c+d x)}{(a+b \sec (c+d x))^{3/2}} \, dx \\ & = \frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}+\frac {b \int \frac {\sec (c+d x) \left (-\frac {a}{2}-\frac {1}{2} b \sec (c+d x)\right )}{\sqrt {a+b \sec (c+d x)}} \, dx}{a^2-b^2} \\ & = \frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {b \int \sec (c+d x) \sqrt {a+b \sec (c+d x)} \, dx}{2 \left (a^2-b^2\right )} \\ & = \frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}}-\frac {b \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx}{2 (a+b)}-\frac {b^2 \int \frac {\sec (c+d x) (1+\sec (c+d x))}{\sqrt {a+b \sec (c+d x)}} \, dx}{2 \left (a^2-b^2\right )} \\ & = \frac {\cot (c+d x) E\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right )|\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{\sqrt {a+b} d}-\frac {\cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{\sqrt {a+b} d}+\frac {2 \sqrt {a+b} \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a+b}{a},\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{a d}-\frac {\cot (c+d x)}{d \sqrt {a+b \sec (c+d x)}}+\frac {b^2 \tan (c+d x)}{\left (a^2-b^2\right ) d \sqrt {a+b \sec (c+d x)}} \\ \end{align*}
Time = 13.15 (sec) , antiderivative size = 366, normalized size of antiderivative = 1.01 \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\frac {\left (-8 b (a+b) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \cot \left (\frac {1}{2} (c+d x)\right ) E\left (\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right )|\frac {a-b}{a+b}\right )-8 \left (2 a^2-a b-3 b^2\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \cot \left (\frac {1}{2} (c+d x)\right ) \operatorname {EllipticF}\left (\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ),\frac {a-b}{a+b}\right )+4 (a-b) \csc ^2(c+d x) \left (2 \cos (c+d x) (b+a \cos (c+d x))+32 (a+b) \cos ^3\left (\frac {1}{2} (c+d x)\right ) \sqrt {\frac {\cos (c+d x)}{1+\cos (c+d x)}} \sqrt {\frac {b+a \cos (c+d x)}{(a+b) (1+\cos (c+d x))}} \operatorname {EllipticPi}\left (-1,\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ),\frac {a-b}{a+b}\right ) \sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \tan (c+d x)}{8 \left (-a^2+b^2\right ) d \sqrt {a+b \sec (c+d x)}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(1373\) vs. \(2(330)=660\).
Time = 7.10 (sec) , antiderivative size = 1374, normalized size of antiderivative = 3.81
[In]
[Out]
\[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\int { \frac {\cot \left (d x + c\right )^{2}}{\sqrt {b \sec \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
\[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\int \frac {\cot ^{2}{\left (c + d x \right )}}{\sqrt {a + b \sec {\left (c + d x \right )}}}\, dx \]
[In]
[Out]
\[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\int { \frac {\cot \left (d x + c\right )^{2}}{\sqrt {b \sec \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
\[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\int { \frac {\cot \left (d x + c\right )^{2}}{\sqrt {b \sec \left (d x + c\right ) + a}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {\cot ^2(c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx=\int \frac {{\mathrm {cot}\left (c+d\,x\right )}^2}{\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}}} \,d x \]
[In]
[Out]